package cn.burnit.view;


import cn.burnit.utils.BookTableModel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 查询所有图书界面
 */
public class CheckAllBookForm extends JFrame {


    private JButton btn_Cancel;
    private JScrollPane scrollPane;
    private BookTableModel model;
    private JTable table=new JTable();

    public CheckAllBookForm() {

        Container container = getContentPane();
        container.setLayout(null);

        btn_Cancel=new JButton("关闭");
        btn_Cancel.setBounds(350,30,80,20);

        btn_Cancel.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });

        model = new BookTableModel();
        table.setModel(model);
        table.getColumnModel().getColumn(0).setHeaderValue("图书编号");
        table.getColumnModel().getColumn(1).setHeaderValue("图书名称");
        table.getColumnModel().getColumn(2).setHeaderValue("图书类别");
        table.getColumnModel().getColumn(3).setHeaderValue("作者");
        table.getColumnModel().getColumn(4).setHeaderValue("译者");
        table.getColumnModel().getColumn(5).setHeaderValue("出版社");
        table.getColumnModel().getColumn(6).setHeaderValue("出版日期");
        table.getColumnModel().getColumn(7).setHeaderValue("定价");
        table.getColumnModel().getColumn(8).setHeaderValue("库存数量");
        table.getColumnModel().getColumn(9).setHeaderValue("已借数量");
        scrollPane=new JScrollPane(table);

        scrollPane.setBounds(20,120,750,400);

        container.add(btn_Cancel);
        container.add(scrollPane);



        setTitle("图书查询");
        setSize(800,600);
        setLocationRelativeTo(null);
        setResizable(false);
        setVisible(true);
        //setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }



//    public static void main(String[] args) {
//        new CheckAllBookForm();
//    }
}
